<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员充值管理管理</title>
<link  href="skin/css/style.css" rel="stylesheet" type="text/css" />
<script src="skin/js/common.js" type="text/javascript"></script>
<script src="skin/js/main.js" type="text/javascript"></script>
</head>
<body>
<!--当前导航-->
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;会员&nbsp;&raquo;&nbsp;会员充值管理 ';</script>
<?php
$numPerPage=1;
$whereorder = "";
$search = isset($_GET['keyword']) && $_GET['keyword'] ? $_GET['keyword'] : '';
$keyword = RemoveXSS($search);
if($keyword){
	$whereorder = "  AND ((username LIKE '%{$keyword}%') OR (id = '{$keyword}'))";
}
$type = isset($_GET['type']) && $_GET['type'] ? (int)$_GET['type'] : 0;
if($type){
	$whereorder .= " AND gid = '{$type}'";
}
$order  = isset($_GET['order']) && $_GET['order'] ? (int)$_GET['order'] : -1;
if($order > 0){
	$order_sea = $order != 1 ? 0 : 1;
	$whereorder .= " AND status = '{$order_sea}'";
}
$n_commend  = '';
$csqlStr="select count(*) as dd from `{$cfg_dbprefix}pay_record` where 1= 1 ".$whereorder;
$row = $dsql->GetOne($csqlStr);
if(is_array($row)){
	$TotalResult = $row['dd'];
}else{
	$TotalResult = 0;
}
$TotalPage = ceil($TotalResult/$numPerPage);
if ($page>$TotalPage){
	$page=$TotalPage;
} 
$limitstart = ($page-1) * $numPerPage;
if($limitstart<0){
 $limitstart=0;
}
	$sqlStr="select * from {$cfg_dbprefix}pay_record  where 1=1 ".$whereorder."  ORDER BY id DESC limit $limitstart,$numPerPage";
?>
<div class="r_main">
  <div class="r_content">
    <div class="r_content_1">
      <table class="tb_style" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td colspan="15" class="td_title">&nbsp;会员充值管理</td>
        </tr>
        <tr>
          <form action="" method="get" >
            <td height="40" align="left" colspan="10">&nbsp;关键字&nbsp;
              <input  name="keyword" type="text" id="keyword" size="40"  value="<?php echo $keyword;?>" placeholder="请输入用户名或者编号">
			  <select name="type" id="type">
					<option value="0">充值用户组</option>
					<?php foreach($user_group as $key=>$item){ ?>
					<option value="<?php echo $key;?>" <?php  if($type == $key){ ?> selected <?php }?> ><?php echo $item['gname'];?></option>
					<?php }?>
				</select>
				 <select name="order" id="order">
					<option value="0" >状态</option>
					<option value="1" <?php  if($order == 1){ ?> selected <?php }?> >已付款</option>
					<option value="2" <?php  if($order == 2){ ?> selected <?php }?> >未付款</option>
				</select>
              <input type="submit" name="selectBtn" value="查 询..." class="btn"  />
             </td>
			  <td>
				
			   </td>
          </form>
        </tr>
        <tr bgcolor="#f5fafe">
          <td height="30" align="center" bgcolor="#FFFFFF" class="td_btop3">&nbsp;ID</td>
          <td bgcolor="#FFFFFF" class="td_btop3">用户</td>
          <td bgcolor="#FFFFFF" class="td_btop3">充值金额</td>
          <td bgcolor="#FFFFFF" class="td_btop3">充值的用户组</td>
          <td bgcolor="#FFFFFF" class="td_btop3">状态</td>
           <td bgcolor="#FFFFFF" class="td_btop3">创建时间</td>
		    <td bgcolor="#FFFFFF" class="td_btop3">付款时间</td>
		  <td align="center" bgcolor="#FFFFFF" class="td_btop3">操作</td>
        </tr>
        <form method="post" name="videolistform">
          <?php

$dsql->SetQuery($sqlStr);
$dsql->Execute('video_list');
while($row=$dsql->GetObject('video_list'))
{
$n_id=$row->id;
//$tid=$row->tid;
//$contentUrl=getArticleLink($tid,$n_id,'');
?>
          <tr bgcolor="#f5fafe" id="topictr<?php echo $row->id;?>">
            <td height="30" class="td_border" style="text-align:center"><input type="checkbox" value="<?php echo $row->id;?>" name="e_id[]" class="checkbox" />
              <?php echo $row->id; ?></td>
            <td class="td_border"><?php echo $row->username;?></td>
            <td class="td_border"><?php echo $row->money;?></td>
			 <td class="td_border"><?php echo $user_group[$row->gid]['gname'];?></td>
			
           
            <td class="td_border"><?php echo $pay_status[$row->status];?></td>
             <td class="td_border"><span title="<?php echo date('Y-m-d H:i:s',$row->ctime);?>"><?php echo date('Y-m-d H:i:s',$row->ctime);?></span></td>
			  <td class="td_border"><span title="<?php echo date('Y-m-d H:i:s',$row->ctime);?>"><?php echo $row->paytime ? date('Y-m-d H:i:s',$row->paytime) : '等待付款';?></span></td>
			<td class="td_border" align="center">
				<a href="?action=show&id=<?php echo $row->id;?>">详细</a>
          </tr>
          <?php }?>
          <tr>
            <td height="30" colspan="11" class="td_border">
              
          </tr>
        </form>
        <tr>
          <td height="30" colspan="11" class="td_border">
            <div class="cuspages">
              <div class="pages"> &nbsp;页次：<?php echo $page;?>/<?php echo $TotalPage;?> 每页<?php echo $numPerPage;?> 总收录数据<?php echo $TotalResult;?>条 <a href="?page=1&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">首页</a> <a href="?page=<?php echo ($page-1);?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">上一页</a> <?php echo makePageNumber($page, 10, $TotalPage, "videolist");?> <a href="?page=<?php echo ($page+1);?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">下一页</a> <a href="?page=<?php echo $TotalPage;?>&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>">尾页</a>&nbsp;&nbsp;跳转
                <input type="text" id="skip" value="" onkeyup="this.value=this.value.replace(/[^\d]+/,'')" style="width:40px"/>
                &nbsp;&nbsp;
                <input type="button" value="确定" class="btn" onclick="location.href='?page='+ document.getElementById('skip').value +'&order=<?php echo $order;?>&type=<?php echo $type;?>&keyword=<?php echo $keyword;?>&n_commend=<?php echo $n_commend;?>';"/>
              </div>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
</div>
<?php
viewFoot();
?>
</body>
</html>
